package com.example.admin.controller;


import com.example.common.logmapper.LogMapper;
import com.example.common.result.PageBean;
import com.example.common.result.Result;
import com.example.model.log.pojo.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class LogController {
    @Autowired
    private LogMapper logMapper;
    @GetMapping("/admin/logs")

    public Result selectAllLogs(){
        List<Log> page = logMapper.selectAllLogs();
        int size = page.size();
        PageBean pageBean = new PageBean(size,page);
        return Result.success(pageBean);
    }
}
